#include "selectsubwindowdialog.h"
#include "ui_selectsubwindowdialog.h"
#include "common.h"

SelectSubWindowDialog::SelectSubWindowDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::SelectSubWindowDialog)
{
    ui->setupUi(this);
	connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
	connect(ui->mainWindowButton, SIGNAL(clicked()), this, SLOT(onMainWindowClicked()));
	connect(ui->mainWindowButton, SIGNAL(clicked()), this, SIGNAL(accepted()));
	connect(ui->slaveWindowButton, SIGNAL(clicked()), this, SLOT(onSlaveWindowClicked()));
	connect(ui->slaveWindowButton, SIGNAL(clicked()), this, SIGNAL(accepted()));
}

SelectSubWindowDialog::~SelectSubWindowDialog()
{
    delete ui;
}

void SelectSubWindowDialog::onMainWindowClicked()
{
	m_SelectedWindowNo = g_MainWindowNo;
	hide();
	accept();
}

void SelectSubWindowDialog::onSlaveWindowClicked()
{
	m_SelectedWindowNo = g_SlaveWindowNo;
	hide();
	accept();
}
